package com.aaron.messenger.net;

import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;

public class SendFileSession extends Session {
	
	private Socket mSocket;
	private ArrayList<String> mSendList;
	
	private SendFileSession(Socket socket, ArrayList<String> sendlist, SessionStateChangedListener listener) {
		super(listener);
		mSocket = socket;
		mSendList = sendlist;
	}
	
	public static SendFileSession createSendSession(String server, ArrayList<String> filelist, SessionStateChangedListener listener) {
		SendFileSession session = null;
		try {
			InetAddress address = InetAddress.getByName(server);
			Socket socket = new Socket(address, NetPort.FILE_TRANSER_SERVER_PORT);
			session = new SendFileSession(socket, filelist, listener);	
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return session;
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void start() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void stop() {
		// TODO Auto-generated method stub
		
	}
}
